
var app = angular.module('breadTrip', []);

app.config(['$interpolateProvider', function($interpolateProvider) {
    $interpolateProvider.startSymbol('{[');
    $interpolateProvider.endSymbol(']}');
}]);

app.controller('orderDetailController', ['$scope', function($scope){
    $scope.storageName = BT.context('storageName');

    // order status
    var cancel_array = [4, 5, 6, 9, 10, 11];
    if (obj.status == 2){
        obj.status = 'success';
    } else if (cancel_array.indexOf(obj.status) != -1) {
        obj.status = 'cancel';
    } else if (obj.status == 13 ) {
        obj.status = 'refund';
    } else {
        obj.status = 'done';
    }

    // voucher
    if (obj.is_supplier_voucher) {
        obj.voucher = 'supplier';
    } else if (!obj.is_supplier_voucher && obj.is_paper_voucher) {
        obj.voucher = 'paper';
    } else {
        obj.voucher = 'view';
    };

    // 动态数据
    $scope.res = obj;

    /** 
    **  basic     ———— 产品基本信息
    **  contact             ————  联系人信息
    **  extended             ————  备注信息
    **  agreement         ————gi  接受协议
    **  total_price       ————  总价格

    **/ 
    //  初始化
    $scope.init = function(){
        $scope.$watch("res", function(){});
    };

    $scope.init();
}]);